<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
<title>replyUpdate </title>
</head>

<script type="text/javascript">
	jQuery.noConflict();
	jQuery(".updatereply").click(function(){
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0,idx+5);
		var sr_no = jQuery(this).attr("id");
		var context = jQuery(".uptext").val();
		var sb_no = jQuery(".uptext").attr("id");
		if(context == ""){
			alert("글을 입력하세요.");
		}
		else{
			jQuery.ajax({
				url : str + "/replySupdate.reply?sr_no="+sr_no+"&context="+context+"&sb_no="+sb_no,
				error:function(data){
					alert("오류 발생");
				},
				success : function(data){
					jQuery(".reply").html(data);
				}
			});
		}
	});
</script>

<body>

<table>
	<tr>
		<c:forEach var="update" items="${update}" >
			<td colspan="3"><input type="text" id="${update.sr_sb_no}" class="uptext" style="width: 200px;" value="${update.sr_context}"></td><td><input type="button" id="${update.sr_no}" class="updatereply" value="입력"></td>
		</c:forEach>
	</tr>
</table>

</body>
</html>